package ch06;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Test2 {
    private static ApplicationContext applicationContext ;
    static {
        applicationContext = new ClassPathXmlApplicationContext("ch06/spring2.xml") ;
    }

    public static  void test1(){
        PersonDao personDao = (PersonDao) applicationContext.getBean("personDao") ;
        personDao.del(1);
    }

    public static  void test2(){
        PersonDao personDao = (PersonDao) applicationContext.getBean("personDao") ;
        personDao.save(new Person()) ;
    }

    public static void main(String[] args) {
        test1();
    }
}
